<template>
	<view class="content">
		<view class="layout">
			<view class="box" v-for="(item,index) in arrs" :key="item._id">
				<view class="pic">
					<image :src="item.url" mode="widthFix"></image>
				</view>
				<view class="text">{{item.content}}</view>
				<view class="author">--{{item.author}}</view>
			</view>
		</view>
	</view>
</template>

<script setup>
import {ref} from 'vue'
const arrs = ref([]);
// console.log(arrs.value.map(item=>item.url));
const preView = function(index){
	let urls = arrs.value.map(item => item.url);
	uni.previewImage({
		current:index,
		urls: urls
	})
}
function getData(){
	uni.request({
		url:'https://tea.qiannian8.com/tools/petShow',
		data:{
			size:5
		}
	}).then((res)=>{
		arrs.value = res.data.data;
		console.log(res);
	}).catch(err=>{
		
	})
}
</script>

<style lang="scss">
	.content{
		.layout{
			padding: 50rpx;
			.box{
				margin-bottom: 60rpx;
				border-radius: 20rpx;
				box-shadow: 0 10rpx 30rpx rgba(0,0,0,0.09);
				.pic{
					image{
						width: 100%;
					}
				}
				.text{
					padding: 30rpx 0 30rpx 0;
					font-size: 36rpx;
					color: #969696;
				}
				.author{
					padding-bottom: 30rpx;
					padding-right: 10rpx;
					text-align: right;
					font-size: 24rpx;
					color: #bebebe;
				}
			}
		}
	}
</style>
